"""my_vue URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from apps.users import views
from apps.search import views as views_search
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
    path('admin/', admin.site.urls),
    path('check_username/', views.check_username),  # 确认用户名是否存在
    path('add_user/', views.add_user),  # 用户注册
    path('check_password/', views.check_password),  # 确认密码是否正确
    path('update_password/', views.update_password),  # 修改密码
    path('search_text/', views_search.search_text),  # 用户输入数据的处理
    path('search_text_1/', views_search.search_text_1),
    path('add_history/', views_search.add_history),# 搜索历史记录的存储
    path('find_email/', views.find_email),
    path('get_history/', views_search.get_history),
    path('query_hist/',views_search.query_hist),
    path('delete_search/', views_search.delete_search),
    path('delete_searches/',views_search.delete_searches),
    path('export_search_excel/', views_search.export_search_excel)
]
#添加这行--- 允许所有的media文件被访问
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)